@extends('admin.master')

@section('title', '历史记录')
	
@section('firstItem')
@parent
				<span class="linkBtn" onclick="window.location.href='/admin/device/index'">设备列表</span> &raquo; 
				<span>历史记录</span>
				<input class="a_indexbg" type="hidden" value="devicelist" />
				
@stop
@section('searchList')
@parent
				<!-- <div class="Content1 installUser">安装用户：</div><div class="Content2 userNameBox">{{ $install_info->customer_name or '' }}</div> -->
				<div class="Content1 phoneNum">手机号码：</div><div class="Content2 phoneBox">{{ $install_info->phone or '' }}</div>
				<div class="Content1 address">安装地址：</div><div class="Content2 addressBox">{{ $install_info->installation_address or '' }}</div>
@stop
@section('dataTables')
@parent
			<table class="dataHistoryNote dataTables" cellspacing="0" cellpadding="0">
				<thead>
					<tr>
						<td>序号</td>
						<td>设备编号</td>
						<td>用户名</td>
						<td>剩余流量</td>
						<td>滤芯1</td>
						<td>滤芯2</td>
						<td>滤芯3</td>
						<td>滤芯4</td>
						<td>滤芯5</td>
						<td>原水TDS</td>
						<td>净水TDS</td>
						<td>水机状态</td>
						<td>记录时间</td>
						<td>经销商</td>
					</tr>
				</thead>
				<tbody>
					@for($i=0, $recordCount=count($device_records); $i<$recordCount; $i++)
						@if($device_records[$i]->dec_status == 2)
					<tr class="lessWaterBg">
						@elseif($device_records[$i]->dec_status == 4)
					<tr class="serviceBg">
						@elseif($device_records[$i]->dec_status == 9)
					<tr class="shutDownBg">
						@else
					<tr >
						@endif
						<td>{{ $i+1 }}</td>
						<td devicecodeVal>{{ $device_records[$i]->device->code }}</td>
						<td>{{ $device_records[$i]->device->installInfo->customer_name or '尚未录入' }}</td>
						<td>{{ $device_records[$i]->residual_flow }}L</td>
						<td>{{ $device_records[$i]->filter1 }}%</td>
						<td>{{ $device_records[$i]->filter2 }}%</td>
						<td>{{ $device_records[$i]->filter3 }}%</td>
						<td>{{ $device_records[$i]->filter4 }}%</td>
						<td>{{ $device_records[$i]->filter5 }}%</td>
						<td>{{ $device_records[$i]->TDS1 }}</td>
						@if($device_records[$i]->TDS2 >= 40)
						<td class="warningBg">
						@else
						<td>
						@endif
						{{ $device_records[$i]->TDS2 }}</td>
						<td>{{ $device_records[$i]->device_status_description }}</td>
						<td>{{ $device_records[$i]->created_at }}</td>
						<td>{{ $device_records[$i]->device->installInfo->dealer or '尚未录入' }}</td>
					</tr>
					@endfor
				</tbody>
			</table>
@stop
@section('page_num')
<ul class="pagination pagination-lg"> 
	{!! $device_records->render() !!}
</ul>
@stop
@section('infor_promit')
@parent	

@stop

<script>
					window.onload=function(){
						$(".devicelist").css("backgroundColor","#224247").siblings().css("backgroundColor","#365d62");
					}
				</script>